package com.jingdianjichi.subject.infra.basic.ES.自定义ES_鸡翅.common;

import lombok.Data;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;
import org.elasticsearch.search.sort.SortOrder;

import javax.swing.*;

/**
 * ES的请求类,用户封装查询参数的亲
 */
@Data
public class ESSearchRequest {

    //专门帮助我们查询条件做服务的亲,这个歌就是做,精确查询和过滤查询的亲
    private BoolQueryBuilder bq;

    //数组,就是比如我们查了redis我们希望,在题目名称和答案中都去搜索的,在这里指定字段
    //查询字段
    private String[] fields;

    //ES的分页参数,页数
    private int from;

    //每页的条数
    private int size;

    //是否要存储快照
    private Boolean needScroll;
    
    //快照的缓存时间
    private Long minutes;

    //指定排序的字段
    private String sortName;

    //指定排序的类型是顺序排还是倒序排
    private SortOrder sortOrder;

    //高亮builder
    private HighlightBuilder highlightBuilder;
}
